﻿using System;
using System.Data;
using System.Data.Common;

namespace ZhangBY.Data
{
    public abstract class ADbSupplier
    {
        /// <summary>
        /// 返回DbProviderFactory实例
        /// </summary>
        /// <returns></returns>
        public abstract DbProviderFactory DbFactory();
        /// <summary>
        /// 检索SQL参数信息并填充
        /// </summary>
        /// <param name="cmd"></param>
        public abstract void DeriveParameters(IDbCommand cmd);

        /// <summary>
        /// 创建SQL参数
        /// </summary>
        /// <param name="paramName"></param>
        /// <param name="dbType"></param>
        /// <returns></returns>
        public abstract DbParameter CreateParam(string paramName, DbType dbType);
        /// <summary>
        /// 创建SQL参数
        /// </summary>
        /// <param name="paramName"></param>
        /// <param name="dbType"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        public abstract DbParameter CreateParam(string paramName, DbType dbType, Int32 size);

       /// <summary>
       /// 是否支持数据库收缩
       /// </summary>
       /// <returns></returns>
        public abstract bool IsShrinkData();
       /// <summary>
       /// 是否支持存储过程
       /// </summary>
       /// <returns></returns>
        public abstract bool IsStoreProc();
       /// <summary>
       /// 是否支持备份数据库
       /// </summary>
       /// <returns></returns>
        public abstract bool IsBackupDataBase();
        /// <summary>
        /// 取得刚插入的自增ID
        /// </summary>
        /// <returns></returns>
        public abstract string GetLastId();


    }
}
